<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
</head>
<body>
    <h1>Nuevos usuarios en las últimos 2 semanas</h1>
    <div id="usuarios_14_dias"></div>
</body>
</html>

<script type="text/javascript" src="http://www.google.com/jsapi?key={{ GOOGLE_API_KEY }}"></script>
<script type="text/javascript"><!--
    google.load("visualization", "1", {packages:["corechart"]});
    google.setOnLoadCallback(function() {
        var data = new google.visualization.DataTable();
        data.addColumn('string', 'Día');
        data.addColumn('number', 'Usuarios nuevos');
        data.addRows({{ users_stats|length }});

        {% for s in users_stats %}  
            data.setValue({{ forloop.counter0 }}, 0, '{{ s.0|date:"d M" }}');
            data.setValue({{ forloop.counter0 }}, 1, {{ s.1 }});
        {% endfor %}

        var chart = new google.visualization.LineChart(document.getElementById('usuarios_14_dias'));
        chart.draw(data, {width: 620, height: 200, legend:'none'});
    });